package apt.bean;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "TBUSER")
public class UserBean implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = -4550325104624633023L;

	@Id
	@GeneratedValue
	@Column(name = "USERID")
	private int userID;

	@Column(name = "USERNAME")
	private String userName;

	@Column(name = "PASSWORD")
	private String password;

	@Column(name = "FULLNAME")
	private String fullName;

	@Column(name = "ADDRESS")
	private String address;

	@Column(name = "PHONE")
	private String phone;

	@Column(name = "EMAIL")
	private String email;

	@Column(name = "GENDER")
	private boolean gender;

	@Column(name = "BALANCE")
	private float balance;

	@Column(name = "STATUS")
	private boolean status;

	@ManyToOne
	@JoinColumn(name = "RoleID")
	private RoleBean roleBean;

	@OneToMany(mappedBy = "userBean")
	private Set<OrderBean> orderBeans;

	@OneToMany(mappedBy = "userBean")
	private Set<FeedbackBean> feedbackBeans;

	public UserBean(String userName, String password, String fullName,
			String address, String phone, String email, boolean gender,
			float balance, boolean status, RoleBean roleBean) {
		super();
		this.userName = userName;
		this.password = password;
		this.fullName = fullName;
		this.address = address;
		this.phone = phone;
		this.email = email;
		this.gender = gender;
		this.balance = balance;
		this.status = status;
		this.roleBean = roleBean;
	}

	public UserBean() {
		// TODO Auto-generated constructor stub
	}

	public int getUserID() {
		return userID;
	}

	public void setUserID(int userID) {
		this.userID = userID;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getFullName() {
		return fullName;
	}

	public void setFullName(String fullName) {
		this.fullName = fullName;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public boolean isGender() {
		return gender;
	}

	public void setGender(boolean gender) {
		this.gender = gender;
	}

	public float getBalance() {
		return balance;
	}

	public void setBalance(float balance) {
		this.balance = balance;
	}

	public boolean isStatus() {
		return status;
	}

	public void setStatus(boolean status) {
		this.status = status;
	}

	public RoleBean getRoleBean() {
		return roleBean;
	}

	public void setRoleBean(RoleBean roleBean) {
		this.roleBean = roleBean;
	}

	public Set<OrderBean> getOrderBeans() {
		return orderBeans;
	}

	public void setOrderBeans(Set<OrderBean> orderBeans) {
		this.orderBeans = orderBeans;
	}

	public Set<FeedbackBean> getFeedbackBeans() {
		return feedbackBeans;
	}

	public void setFeedbackBeans(Set<FeedbackBean> feedbackBeans) {
		this.feedbackBeans = feedbackBeans;
	}

}
